<template>
	<view>
		<view class="rencent_box">
			<view class="rencent_list">
				<view class="rencent_item" v-for="(item,index) in recent_list" :key="index" @tap="to_serve(item)">
					<image :src="item.src"></image>
					<view class="text">{{item.name}}</view>
				</view>
			</view>
		</view>
		<!-- #ifdef H5 && WUYE -->
		<view class="order_box">
			<view class="order_title">我的订单</view>
			<view class="order_list">
				<view class="list">
					<view class="item" v-for="(item,index) in order_list" :key="index" @tap="toMallOrders()">
						<image :src="item.src"></image>
						<view class="text">{{item.name}}</view>
					</view>
				</view>
			</view>
		</view>
		<!-- #endif -->
		<view class="cu-list menu server-bottom">
			<template v-for="(item,index) in serve_list">
				<view class="cu-item arrow" @tap="to_serve(item)">
					<view class="content">
						<div class="menu_image">
							<image class="menu_image" :src="item.src" />
						</div>
						<view class="text">{{item.name}}</view>
					</view>
				</view>
			</template>
		</view>
	</view>
</template>

<script>
	import context from '@/lib/java110/Java110Context.js';
	const factory = context.factory; //获取app实例
	const constant = context.constant;
	export default {
		name: "myMenu",
		data() {
			return {
				order_list: [{
						name: '待付款',
						src: this.imgUrl + '/h5/images/serve/order1.png',
						href: ''
					},
					{
						name: '待发货',
						src: this.imgUrl + '/h5/images/serve/order2.png',
						href: ''
					},
					{
						name: '待收货',
						src: this.imgUrl + '/h5/images/serve/order3.png',
						href: ''
					},
					{
						name: '已完成',
						src: this.imgUrl + '/h5/images/serve/order4.png',
						href: ''
					}
				],
				recent_list: [{
						name: '我的房屋',
						src: this.imgUrl + '/h5/images/serve/my3.png',
						href: '/pages/my/myHouse'
					},
					{
						name: '我的报修',
						src: this.imgUrl + '/h5/images/serve/my4.png',
						href: '/pages/repair/myRepair'
					},
					{
						name: '缴费记录',
						src: this.imgUrl + '/h5/images/serve/my5.png',
						href: '/pages/fee/payFeeDetail'
					},
					{
						name: '我的车位',
						src: this.imgUrl + '/h5/images/serve/my6.png',
						href: '/pages/applyparking/parkingInfo'
					},
				],
				serve_list: [
					{
						name: '我的物业',
						src: this.imgUrl + '/h5/images/serve/my2.png',
						href: '/pages/my/myProperty'
					},
					{
						name: '我的投诉',
						src: this.imgUrl + '/h5/images/serve/11.png',
						href: '/pages/complaint/complaintList'
					},
					{
						name: '门禁日志',
						src: this.imgUrl + '/h5/images/serve/my9.png',
						href: '/pages/machine/machineTranslateLog'
					},
					{
						name: '装修记录',
						src: this.imgUrl + '/h5/images/serve/my10.png',
						href: '/pages/renovation/myRoomList'
					},
					{
						name: '订场记录',
						src: this.imgUrl + '/h5/images/serve/my8.png',
						href: '/pages/appointment/myBoomList'
					},
					{
						name: '预约记录',
						src: this.imgUrl + '/h5/images/serve/my8.png',
						href: '/pages/reserve/reserveMyOrder'
					},
					{
						name: '放行记录',
						src: this.imgUrl + '/h5/images/serve/my8.png',
						href: '/pages/itemRelease/myItemReleaseList'
					},
					{
						name: '空置房记录',
						src: this.imgUrl + '/h5/images/serve/my8.png',
						href: '/pages/applyRoom/myRoomList'
					},
				]
			};
		},
		created() {

		},
		methods: {
			// 我的服务跳转
			to_serve(v) {
				this.vc.navigateTo({
					url: v.href,
				})
			},
			ckeckUserInfo: function() {
				return context.checkLoginStatus();
			},
			toMallOrders() {
				if (!this.ckeckUserInfo()) {
					this.vc.navigateTo({
						url: '../login/showlogin'
					}, () => {
						this.refreshPageLoginInfo();
					});
					return;
				}
				this.vc.navigateToMall({
					url: '/pages/myOrder/myOrderAll'
				})
			},
		}
	}
</script>

<style lang="less">
	.order_box {
		margin-top: 20upx;

		.order_title {
			line-height: 42upx;
			font-size: 30upx;
			font-weight: 600;
			color: #333;
			padding: 20upx;
		}

		.order_list {
			padding: 20upx 20upx 0;
			background: #fff;
		}

		.item {
			width: 25%;
			display: inline-block;
			text-align: center;
			margin-bottom: 20upx;
		}

		image {
			height: 44upx;
			width: 44upx;
		}

		.text {
			color: #333;
			font-size: 28upx;
		}
	}
	.rencent_box {
		padding: 0 20upx;
		background: #fff;
		margin: 1upx 0 0 0;
		border-radius: 4px;
	
		.rencent_title {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 20upx 0;
			font-size: 30upx;
			font-weight: 600;
	
			.more {
				font-size: 24upx;
				font-weight: 400;
				color: #999;
			}
		}
	
		.rencent_list {
			border-radius: 5px;
		}
	
		.rencent_item {
			display: inline-block;
			padding: 20upx;
			width: 25%;
			text-align: center;
			font-size: 28upx;
	
			image {
				height: 64upx;
				width: 64upx;
			}
	
			.text {
				white-space: nowrap;
				font-size: 24upx;
				font-weight: 400;
			}
		}
	}
	.content {
		display: flex;
		flex-direction: row;
	}
	.menu_image {
		height: 38upx;
		width: 38upx;
		margin-right: 8upx;
	}
	.server-bottom {
		margin-bottom: 8upx;
	}
</style>